import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/major_hazard/hazard_archive_entity.dart';

HazardArchiveEntity $HazardArchiveEntityFromJson(Map<String, dynamic> json) {
  final HazardArchiveEntity hazardArchiveEntity = HazardArchiveEntity();
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    hazardArchiveEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    hazardArchiveEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    hazardArchiveEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    hazardArchiveEntity.createDate = createDate;
  }
  final String? createMobile = jsonConvert.convert<String>(json['createMobile']);
  if (createMobile != null) {
    hazardArchiveEntity.createMobile = createMobile;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    hazardArchiveEntity.deleted = deleted;
  }
  final String? fileId = jsonConvert.convert<String>(json['fileId']);
  if (fileId != null) {
    hazardArchiveEntity.fileId = fileId;
  }
  final String? fileName = jsonConvert.convert<String>(json['fileName']);
  if (fileName != null) {
    hazardArchiveEntity.fileName = fileName;
  }
  final String? fileUrl = jsonConvert.convert<String>(json['fileUrl']);
  if (fileUrl != null) {
    hazardArchiveEntity.fileUrl = fileUrl;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    hazardArchiveEntity.id = id;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    hazardArchiveEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    hazardArchiveEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    hazardArchiveEntity.updateDate = updateDate;
  }
  return hazardArchiveEntity;
}

Map<String, dynamic> $HazardArchiveEntityToJson(HazardArchiveEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['createMobile'] = entity.createMobile;
  data['deleted'] = entity.deleted;
  data['fileId'] = entity.fileId;
  data['fileName'] = entity.fileName;
  data['fileUrl'] = entity.fileUrl;
  data['id'] = entity.id;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension HazardArchiveEntityExtension on HazardArchiveEntity {
  HazardArchiveEntity copyWith({
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? createMobile,
    String? deleted,
    String? fileId,
    String? fileName,
    String? fileUrl,
    String? id,
    String? updateBy,
    String? updateById,
    String? updateDate,
  }) {
    return HazardArchiveEntity()
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..createMobile = createMobile ?? this.createMobile
      ..deleted = deleted ?? this.deleted
      ..fileId = fileId ?? this.fileId
      ..fileName = fileName ?? this.fileName
      ..fileUrl = fileUrl ?? this.fileUrl
      ..id = id ?? this.id
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate;
  }
}
